Public Class FrmRegistrar 

    Private Sub BtnRegistrar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnRegistrar.Click
        Try

            If Vinum.ReglaNegociosMetodos.SerialMethod.VerificarSerial(TxtSerial.Text.Trim) = True Then
                DevExpress.XtraEditors.XtraMessageBox.Show(My.Resources.ResMensajes.ReiniciarElSistema, My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Exclamation)
                Application.Exit()
            Else
                DevExpress.XtraEditors.XtraMessageBox.Show(My.Resources.ResMensajes.SerialInvalido, My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand)
                TxtSerial.Focus()
            End If

        Catch ex As SqlException
            DevExpress.XtraEditors.XtraMessageBox.Show(String.Format(My.Resources.ResMensajes.ErrorAlRegistrarPc, ex.Message), My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
        Catch ex As ReglaNegociosMetodosException
            DevExpress.XtraEditors.XtraMessageBox.Show(String.Format(My.Resources.ResMensajes.ErrorAlRegistrarPc, ex.Message), My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
        Catch ex As Exception
            DevExpress.XtraEditors.XtraMessageBox.Show(String.Format(My.Resources.ResMensajes.ErrorDesconocido, ex.Message), My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
        End Try
    End Sub

    Private Sub BtnSalir_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnSalir.Click
        Application.Exit()
    End Sub

    Private Sub FrmRegistrar_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            TxtId.Text = Vinum.ReglaNegociosMetodos.SerialMethod.SerialPc
            If SerialObj.DiasDePrueba = 999999 Then
                DevExpress.XtraEditors.XtraMessageBox.Show(My.Resources.ResMensajes.FinTrial, My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Hand)
                BtnTrial.Enabled = False
            End If

        Catch ex As SqlException
            DevExpress.XtraEditors.XtraMessageBox.Show(String.Format(My.Resources.ResMensajes.ErrorAlRecuperarPcId, ex.Message), My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
        Catch ex As ReglaNegociosMetodosException
            DevExpress.XtraEditors.XtraMessageBox.Show(String.Format(My.Resources.ResMensajes.ErrorAlRecuperarPcId, ex.Message), My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
        Catch ex As Exception
            DevExpress.XtraEditors.XtraMessageBox.Show(String.Format(My.Resources.ResMensajes.ErrorDesconocido, ex.Message), My.Application.Info.ProductName, MessageBoxButtons.OK, MessageBoxIcon.Error)
            Application.Exit()
        End Try
    End Sub

    Private Sub BtnTrial_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnTrial.Click
        TxtSerial.Text = "TRIAL"
        BtnRegistrar_Click(Nothing, Nothing)
    End Sub
End Class